Move the capture and grouping functions to their own file
Rename POSIX to character class

It was used for more than just POSIX character classes, so the previous
name did not really make sense.