Various optimizations and fixes
Merge branch 'master' of github.com:hankmoody/ghost