Abstract out logic to determining field type

Introduces a getFieldType function for determining a field's logical type
corresponding to the desired interface and behavior for query purposes.

Fix #391
Merge pull request #398 from cbmi/issue-391

Abstract out logic to determining field type