resourceloader: Move startup code from PHP to startup.js