preliminary code cleansing and fixes. not done yet, currently have issues with generating invoices, vehicle_invoice is not commited to the database.