Rewrote JS so it is smaller and is more usable.