Fix page rendering when loading for first time
Set prerenderReady when ready
Refactor to $scope.ready method