Python support

Credits to http://sizer99.com/tf/

Patch applied manually (- the mmalloc MAC fix that has been fixed previously)