reorder scripts, we should try to factor all javascript out of jade files