Cleanup, switch to cmake, better OO