Faster implementation of lastIndexOf

A few bytes longer, but should be a little faster / less memory intensive than making a copy and reversing the array.