Fixed PageStateTest so it does not fail when run after NavigationTest
Added PageShown and PageHidden Lifecycle callbacks

I also refactored some code, added and refactored tests