Highly work in progress, going through a big amount of thinking right now.
If you want to see the prototypes in action, check out ALAC.js or FLAC.js.
To build, run build/build from the root using a recent Ruby (I tested with 1.9.3, but shouldn't matter) with the ExecJS gem installed.
To test, use js-test-driver from http://code.google.com/p/js-test-driver/downloads/list, they have a quick start guide. Do not forget to rebuild after doing any changes.