Add index filtering back to brush selection.
Fixed bug where selecting closest point on path was no longer working. Reformatted a couple sections of code to make more readable.