Start of port from Python.  Extreme WIP!