From http://www.javascriptexamples.org/2011/01/17/how-to-implement-a-set-in-javascript/