Initial commit.

This somewhat works. Not extensively tested, though.
Merge pull request #1 from daniel-star/initial-commit

Initial commit.