Lapis rewrite intial commit.
Further re-write and cleanup.
Moving some constants out of LAPIS.
Adding LAPIS cache.

Also including various formatting and cleanup changes.