Rework order detail view

I got sucked into a bad yak-shave while investigating how order statuses are changed in the order detail page. This PR make several improvements to the order detail view, mainly cleaning things up and removing large methods.