Assorted data structure implementations in JavaScript