adding closure for goog.structs.PriorityQueue. Broke off the main routine to be well defined so that it works with window.onload