Added Code Sniffer and PHPMD and fixed some issues