Added user functions and started work on scopes.

Currently, a CodeBlock does NOT define a scope. CodeBlocks have to be
explicitly bound to a scope. This is not currently exposed to the user
code.