convert to hybrid c++/obj-c; add some startup code to main