if possible, use BeautifulSoup v4

The 4th version of BeautifulSoup seems to handle better malformed HTML. It should be used whenever possible. Not sure about the argument `features` though. Tested on python 2.6 and 2.7.