Fixes #1751. Function ids can be plain strings, and we can refer to them as globals rather than via a local identifier. In addition to the bug from $1751 this also cleans up an existing todo.