Initial github commit with mostly working code. Still need to write up a proper manual in the README.md.