Made builder pluggable

Rebased #314 to master, and took out the validation / optimization stuff. I have an idea for how to do that using the config system, but that's better as a separate PR. I think the pluggable builder stuff is pretty important though, so it'd be good to get it in post-haste!