Optimizations and making the code more readable

Changed all element declarations to use document.createElement, as it
turns out to be far faster. Also moved the Header of the table into a
separate container to get ready for allowing scrollable schedulers.