Clean up and refactor

- I added some comments.
- I prefixed all the script variables with `s:`, instead of using global (by
  default) variables.
- I extracted lot of the regexes.

There's still a bug when trying to append `\s*` to the around regex.