Bugfix to rest:resource-functions()

* Fixed issue where AttributesImpl instances were incorrectly reused

* Implemented serialization of output: annotation content.