Reorder init so window opening isn't slowed by resource loading