Major changes to stop JSLint complaining.
Major changes to stop JSLint complaining.

Moving around variable declarations and the like to get JSLint to stop
complaining. Also did some refactoring of code sections into their own
functions.

ProteinsWebTeam/LogoServer,ProteinsWebTeam/LogoServer,ProteinsWebTeam/LogoServer,Janelia-Farm-Xfam/LogoServer,Janelia-Farm-Xfam/LogoServer,Janelia-Farm-Xfam/LogoServer,ProteinsWebTeam/LogoServer,ProteinsWebTeam/LogoServer,Janelia-Farm-Xfam/LogoServer,ProteinsWebTeam/LogoServer,Janelia-Farm-Xfam/LogoServer,Janelia-Farm-Xfam/LogoServer