Refactor typeinfo.
Merge pull request #39 from go-pg/fix/refactor-typeinfo

Refactor typeinfo.