Implemented support for namedtuples (fixes #107)

Note that namedtuples are only supported for Python >2.6.