Begun moving to a better JavaScript structure and exposing methods