Javascript is very messy

Major Refactor is needed very soon.