Switched from std algs to boost range algs

They don't hurt performance, and are a whole lot easier to read! :)