Added caching to the datatype lookup to save database hits

Fixes #90