Initial commit

Initial commit of ugly ugly code. Hope to make things more elegant in
the coming weeks