Class serialization

This pull request makes reflective elements serializable. This way, for example, the REST API can be extended to cache results from ist DefaultRouter using `serialize()` and `unserialize()`.

In a real-life test scenario, this more than tripled the speed of routing setup.