Initial commit. Fairly dirty code.