Refactors types into util.

This moves configuration handling, and predicate handling into a single
util helper.