Partway through refactor
Refactor out contexts
Upgrade to 0.6.5.1 and fix minor bugs