Fix whitespace in templates to match style used elsewhere.

  * Removes trailing whitespace
  * Expands tabs to 4-space indentation, as in python files.