Initial work to compile with FPC/Lazarus

Start fpc/lazarus port. Still does not work