Refresh history table on clock out, refactor some
Refactor JS, use global vars to share data