Fixed unit tests in primitives and optimized pmap write.
Moved fields in prep for new field design.