Cleanup.

Fix typos on #20 and #22, add function signatures.
Merge pull request #23 from demarius/rewrite

Merged, although still breaking build.