Refactored, add some tests, depend on execjs