Major rewrite of nperi functionality. Added standard serialization layer in new nets api.