support to basic test cases

this implementation is passing all the provided test cases and I added a few more.

code is not as clean as possible since I was trying to finish it quickly.

let me know if any more case-scenarios should be supported.

PS: it would be cool to have an option to toggle the behavior for node.js and support "use strict", maybe in a future version.