closes #153 many improvements to type layer (test, docs, refinement)

sounds good, I will add some docs