Initial commit of code

It's been WIP for a while now; I only just got around to creating a repo
on GitHub.