Fix for GH-1038

This pull request makes sure that functions are compiled even if they are only referenced through a function literal and are part of a group of mutually recursive functions.

Fixes GH-1038.