More lovely JS refactoring
Merge remote-tracking branch 'origin/dev' into dev