Try to load script earlier

- Also moved appframework init to bottom of body