Slight speed improvements

Replaced all querySelector and querySelectorAll with getElementById and
getElementsByClassName, as they are apparently faster