Add hex support

Closes #39.