Core refactor

Also includes documentation overhaul