Moved js dependencies to top of file