Add ability to supply a function to `command`

Closes #38
Fixes #37
0.3.0