Initial code commit

I'll tidy it up a bit in the next commit - quickly hacked in the config
bit.