Minor cleanup with namespaces. Also added `findFirst` and `findLast`.