Support dicts as functions

Closes #9