turned js.Global and js.This into package variables to allow the use of a mock object when testing (related to #17)