fixes and performance improvements

Converted substitutions object into array
Creating the regular expressions only once (todo: put them into the extension local storage and have an options script to modify them)

walk is called at the end of the script instead of the beginning