Modularised inline JS and updated grunt configuration to support it.