Refactor dir structure and add pom.xml to allow building with Maven