Add Document::toArray() method

* Add an easy way to get all domain object properties as an array. 
* Add missing `phpunit` dependency.