updated Python referer_parser to match Java version, added tests