Allow globals and functions to be set in options
Added tests for #1653
Updated History