Added a 'regexable' mode for ANSIString, fixed a few bugs with it.

Refactored with metaclass and added comments. Resolves #481, Resolves #480