Add intelij project structure and minor fixes