Add frameworks, make static vars member variables, fix the xcode project