Return an exit code on error

This allows an errback to be optionally passed into compile_project. The
roots binary then takes advantage of this functionality to pass in an exit
handler. Tests modified to check for both the success and failure case.