Added debugging facilities to the cumulative_result class and moved it to the detail/shared.hpp header.