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

I think if we are going to change formatting, we should reformat code and all start using new formatting