change how functions work

![image](https://cloud.githubusercontent.com/assets/1767466/3883677/4389f942-21a4-11e4-9641-40d6a1df618b.png)

Blockly-core portion of changes.  There will also be a blockly PR. Let me know if you have questions.