reworked javascript/stylesheet loading