Add main class, exception class, unittest and phpdoc.