Moved to maven and rewrote almost everything