Split things out, use Ruby's alloc stuff.
Get things working.
Int -> Long, and add a binary search.
Add a ruby flat sorted map.
Use the preprocessor to save some repetition.
Add DoubleArray.
Extract insert.
Put array append somewhere better.