Complete refactor of JavaScript and small CSS changes.