Import code from sourceforge

Should be good to go.