organizational changes. added some ptr<->index lookups to p_alloc.
Lattice: bug fixes, optimizations, unit tests.
Cleanup: removed unused functionality, adjusted function naming scheme.