comitting final ruby-only version. To be pulled and forked into a
backbone-ruby hybrid.