Refactored webspace collection array serialization

- Moved responsability for converting objects to arrays to the objects
  themeselves to enable reuse elsewhere.