Add aria-level attributes; code cleanup

* Work out which level the heading is and assign an appropriate
  aria-level attribute. (Note: current code for this is just for
  testing and is inefficient; refactoring should be done if we
  feel this works, as per the comments.)
* Remove tab characters and keep indentation consistent.