fix removal of function parameters

When creating a function on page load, the FunctionParameter constructor was being passed `this` (which happened to be the browser window object) instead of a reference to the function model.
fixes #122