split cortav into modules, enable use as library, create extension mechanism stub, fix up docs