re-wrote everything in an AMD pattern with requirejs to match panama