Added more unit-tests, fixed PHP 5.3 and accept more callbacks