Implement function definitions.

Untested stuff.
Fix a typo in `push`.