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

need to check length and make sure there is no extra data