Allow custom coerce function

Closes #63
Merge pull request #64 from clee704/master

Allow custom coerce function