Adjust code style for consistency with other projects

* Add space between function keyword and parentheses
* Add parentheses around immediate function calls
* Add parentheses around regular expressions if slashes could be
ambiguous