Reconnecting javascript plus JS tidy-up.