[ticket/11314] Improve readability and code cleanup in new JavaScript files

Due to various changes in the JavaScript files some coding has become obsolete while other code is not as readable as one would expect. Some minor issues seem to have been missed. This PR will fix the small coding issues I was able to find.

Ticket: http://tracker.phpbb.com/browse/PHPBB3-11314

PHPBB3-11314