Cleaned up advagg_init() and advagg_process_html() a bit. Moved more JS functions to the JS include file.