switch to psr-2, add build-system and fix issues