Moved code to functions, started fixing Webkit

Moved data load, UI, and records to functions. I figured out that Chrome
(webkit) is loading everything, but is breaking when the CSS is set in
the jQuery. I'm not sure how to fix this, because if I change it to work
in Chrome it break in Firefox.