Major re-implementation
Merge branch 'master' into 0.2