Add not-entirely-trivial tests, many proving #19
Fix #19 by using inverse index (because rotate rolls right, not left)