Added check for implicit variable declaration 

...to fix test cases for global declarations.
Added check for function declaration to examine upper scope for identifiers.
Cleaned up some unused variables.
Fixed to pass global declaration test case.
Closes: #7
Closes: #8