Refactor edit-header JavaScript

This had recently been refactored, but it's nicer to create a single object for
it, rather than lots of static functions which constantly need to pass required
arguments along.

Change-Id: I5c833b3e8b8974065a87ef05029916998c852de4
Merge "Refactor edit-header JavaScript"