Import and clean up C port of Lift (has been used in various research projects)