fixed bug where flattening a function lost the bindThis value.

Change-Id: Idf652591f62b9b8b93e6a27952bf0bafeeba5c18
Functions can now be compiled and returned from evaluateExpression().

Change-Id: Id1e96dd33dd75a42ee12bd48e5a007e4ec96b598