Added iOS test project and some cleanup + misc fixes