Configuration.cache implemented in a way that does not need the code to be changed
invoice model improvements and tests
minor general fixes