Merge getOpt implementation.

Previous discussion here: http://github.com/23/resumable.js/issues/45
Cleaned up the changes, now ready to merge...