added compat.py

fixed a UnicodeError under git usage
fixed a test for older mercurial version

Btw. there are some fixes inside that are not yet released like a converting bytes to string to prevent from:

"WARNING: Can't update package 'XXX' because its URL doesn't match."

In my local version of git (1.9.1) the regular expression wasn't working, but when i removed the 'Submodules' part it worked. I think it the regex `r'\s+[\'"](.*?)[\'"]\s+\(.+\)'', s(stdout))` is sufficient.