Refactored and script moved to bottom of ka-lite/kalite/distributed/static/js/distributed/distributed-server.js per separate email suggestion.