Fixed inclusion of new Foundation code (lots of it)

Also changed some project builders