Update code with MSApp.execUnsafeLocalFunction()

Wrapping everything in MSApp.execUnsafeLocalFunction() should work, but
Angular Routing still seems to not be happy.