Revert "Get an app reference directly rather than using the locateAncestorNodeOfClass() method, as that method was probably unnecessary anyway, and is causing a failure on Go CI, and sometime on Travis CI, but not my Linux laptop, making it impossible to investigate."

This reverts commit e7ceddf24efe9c92124cf8a343fcf88eb3d69a54.