Improved exceptions and reporting exceptions for command-line compiler.

I think it's not that easy: Parser errors take positions and not locations (although that colud be unified by using zero-length locations), but especially it is important where the location is taken from and I don't see how this could be unified.