title: Get next key-value pair in an object
body: <p>Given a key, I want to find the next property in an object. I can not rely on the keys to be ordered or sequential (they're uuids). Please see below for trivial example of what I want:</p>
  
  <pre><code>var db = {
    a: 1,
    b: 2,
    c: 3
  }
  
  var next = function(db, key) {
    // ???
  }
  
  next(db, 'a');  // I want 2
  next(db, 'b');  // I want 3
  </code></pre>
  
  <p>I also want a prev() function, but I'm sure it will be the same solution.</p>
  
  <p>This seems like such a trivial problem but I can't for the life of me figure out how to do it.</p>
  
  <p>Happy for the solution to use underscore.js or be written in coffeescript :)</p>