SRAI Lookup refactor

Refined the code for SRAI lookup to include looking for matches for a
bot's parent in parent/child situations, and cleaned up some function
calls that were passing information twice. Also removed some orphaned
code and reformatted some functions to make them easier to read.