Changed plugin setup to use RequireJS if present