Clean up in preparation for refactoring.
Major cleanup of code for clarity and efficiency.
Keep track of indices in order to use only slices when possible.
Use brand new Option map_or_else.
Temporarily remove QuickCheck since it won't compile right now and wasn't being used yet.