fixes to make projects compatible with Mono
major refactoring to further SP creation script generation