v0.5a

Still lots of bugs :(
Cleaned up a lot of code.