Added type-specific features as traits, add compare functionality, bugfixes, phpdoc fixes