fixed bug with implied 'this' pointer for methods
added global vars
add newarray allocation