Don't use an explicit out-of-bounds class
Extract bsearch header calculation into a function
Use some scoping within indexof function
Extract the code behind lookup array segmentation
Move the kerx-related code to front
Produce 'kerx' table by default
Keep all of the in-out code in one block