Optimised JS to prevent delayed loading of header elements.

Closes #39