Cleaned up regex references + added more unittests.