Support Unicode in regular expressions and make __version__ static

This pull request allows the regular expressions to support Unicode strings correctly. It also makes __version__ an attribute of setup.py, which simplifies the code.