First draft of type handler code
Merge pull request #1 from einhverfr/master

First draft of type handler code