fast segment tree & priority queue impls and clone of bufio.Scanner