More error reporting

Got bit by rebar throwing away error messages. This patch introduces more logging, which will catch e.g. a broken compiler.