Allow custom coerce function

Closes #63