Version handling support

Changed data structure to handle different versions of invoices