Convert 2-d loc from list to tuple

Slight speed gain by converting 1-d and 2-d locs with built-in
dictionaries instead of running the functions every time.