refactor: simplify caps, chomp, escape_pattern and escape_shell.

* lib/std/string.lua (caps, chomp, escape_pattern, escape_shell):
Remove extraneous parens around return argument.
Use Lua :-method call sugar to shorten gsub invocations.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>