Fix unicode issues

Python 2 needs the unicode constructor in csv formatting.  Python 3 does
not have the unicode constructor anymore.  This commit adds a 'fake'
unicode constructor in Python 3 to ensure compatibility across python
versions.

Also, an encode function is provided, in Python 2, it calls encode('utf-8')
whereas, in Python 3, it directly returns the string.
Update to BeautifulSoup 4 + fix parser for bs4

In bs4, tag.get('class') is a list of classes. This commit fixes
the parser accordingly.