Add red-black tree. Refactor out requirejs config to top-level.