Improve formatting of error messages.

Also adds tests for some exceptional cases.
Adds ability to specify override and abstract in the BindingsFactory.