Move viewInitialization code to C++ side
Merge pull request #238 from rainemak/viewInitializationToCpp

Move viewInitialization code to C++ side