Add util class for scalar types.

Closes #44.

@swankjesse @danrice-square @adriancole