CLN: Refactor refine in prep for speedups (however they are done).

CLN: Comment. Remove relics.
CLN: Move masks into a separate file. Reduces duplication, makes things easier.
API: Expose max_iterations to batch and locate.
API: Expose locate logic to locate/batch through filter_before, filter_after.
PERF: Add simple benchmarks file.
Merge pull request #44 from danielballan/refine-refactor

Refine refactor