Initial commit. Fully tested, but basic first version