Bower dependency hackery

This fixes the current threejs-related brokenness in master, and does some refactoring to make the hackery more palatable.