added requirejs, refactored to allow multiple visualisations at once