Fix regexp expression termination

Javascript statements to be terminated by newlines and EOFs.

Tested with:

 - node -e 're = /GET (\\S+) HTTP/'
 - echo "re = /GET (\\S+) HTTP/\nconsole.log(re)" | node
Fix `substr` and add `substring`

See:

 - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring
 - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr

Tested with:

 - node -e "console.log('hi there'.substr(3, 2))"
 - node -e "console.log('hi there'.substring(3, 5))"
Fix test for negative `substr*`start

Doc sasys "If either argument is less than 0 or is NaN, it is treated as if it were 0."
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring

Trusted MDN, didn't check spec itself.

Tested with:

 - node -e "console.log('test'.substr(-200))"
Merge pull request #18 from cesanta/regexptok

Fix regexp expression termination
Merge pull request #19 from cesanta/fixsubstr

Fix `substr` and add `substring`
Merge pull request #20 from cesanta/negsubstr

Fix test for negative `substr*`start