Refactored totals, removed totals_by_customer. Refactored details, added support to return details by customer.