Make it a working v1.

Sorry for the messy diff - I fixed the white-space :s.
Also there is a TODO for you to fill in. ^^