First commit

This program modifies and improves on riffle.js (in the same repo).