Initial support for user-defined functions and variables
merged