- re-factored so all functions extend native JavaScript objects