Move the current not-really-designed build API over to build.js

This breaks the "API" we already have out into build.js, but isn't supposed to change it much; then the next step is to make it a nicer API.

Even with just this patch, at least people can share the observables with compile.js and run.js without hacks.