Rewrite the dispatcher and get it working.

Fix some test results that were incorrect.
Added a 'testf' target to the build file that stops on the first test failture
Fix specline parsing
Fix resource-type dispatcher