Better Mac support

Hi Stuart,

The changed .cs files will further Mac support. However there also changes to csproj files and added csproj files for file linking support which you probably do not want. Apologies, I need to structure these commits better so you can just do a straight merge.