Reworked some js to use singletonReadyOrPageChange