Handle bracketed escapes better

Implements a POSIX class and a bracket_escape generic function to handle
escaping within character classes more robustly.  Fixes issue #11,
thanks for the bug report @briandconnelly