Made code compatible with Python 2.4

Hi! I had to rewrite some lines to make premailer compatible with Python 2.4. I think it's a great benefit if this module works with many versions of the Python Interpreter so I would love that changes to be merged! Greetings, Gg.