0.5

Massive refactoring for 0.5.