Tidied up namespace using javascript module pattern