Once again, refactor.
Major JS refactor, half done.
Major Refactor done.