Entities are now serializable
Implemented caching mechanism, fixes #7