Add newline replacement support

closes #706
Add test for certain character classes

These features were implemented a while ago but it doesn't appear the
tests were added for it.  Fixing that

closes #1238
Rename group to collection

Changed the terminology around [] from group to collection.  This is the
more common vim terminology and removes the ambiguity with capture
groups.