Various fixes for chrome.

Basic fixes to enable hello world to work in chrome. Chrome is useful for debugging Function objects.
> We should uplift this. Or is this part of the code you added, @mykmelez ?

It's part of the code I added! I landed that code in a separate changeset, ba23ee2dab328fcd289ec2a0268f5deb2b90cc03, to make it easier to distinguish. We should uplift all that code (and this change to it), for which I filed #172.