condense $document.ready function

I condensed the two .ready() methods into one, and moved it into the
<head> section