Adapt to new zend api, add tests