I'm writing a large web application (http://www.annotateit.com) which does some initialization at the head of every script. At the moment, each bit of initialization is custom to each script, but I'd like to change that so that the scripts are a little bit more maintainable. What is the best way to do that?