Introduce maven and fix build errors