Simple singleton pattern in JS