Tweak list sort icons...

1. Move sort icon after heading to be consistent with Joomla.

2. Make icons match sort order consistent with Joomla.

3. Make js cope with alternative html e.g. <i></i><a></a> or vice versa.

(P.S. Most DIFF changes are removal of white space.
Various tweaks to list.js

1. Move setRowTemplate to nearer where it is used.

2. Make error messages consistent.

3. Remove spurious loader.stop lines

4. Switch if/else to switch/case

5. Improve ajax request code.