Project rudimentary converted to Lazarus.
Some cleanup