refactor(JS): Tidies up settings and global module