serious refactoring and shit, probably doesn't work
Merge branch 'registration' of https://github.com/blackchair/helena into registration
code re-org, almost works