rewriting library, adding phpunit, phpdocumentor and travis support