added support for pointer serialization; added trivialCheck(...) to make testing more concise