mod_base: do not redirect if redirect id is set to undefined

(cherry picked from commit 3a7a7a7109d4c9a6b9106b7527850cbcfe601ee7)
mod_base: in do_popupwindow use e.preventDefault() to play nice with multiple click event listeners.

(cherry picked from commit 4f8dfc9952c3076fcc5f89098021037762eb9f7d)
mod_mqtt: fix js error in for loops.

(cherry picked from commit c6f33e0762262ad4362923fe180798f2e22954d5)
core: the {% script %} tag has now arguments.

(cherry picked from commit c2050536fadfac5ff0f0cb9091a44f22f85091b9)
mod_authentication: Refactor twitter/facebook logon and signup code.

Now uses a popupwindow for the authentication.
Twitter and Facebook settings are combined in the admin underneat the 'Auth' menu.
Authenticated users are immediately signed up, no extra checks.

(cherry picked from commit 1c1f7b3c3b9905741a171f9a5439b181e0a918a1)