Refactoring of the JS App part

Refactoring and grouping of the JavaScript app part.

Did this a long time ago but accidentally mix to features in one branch.
Now I found the time to split them up.