Improved efficiency of primesUpTo when enough primes are passed in

- primesUpTo now uses binary search (bisect_right) rather than linear
search to find the position to return up to when enough primes are
passed in - i.e. primes[-1] > x
- Scope of _posOf and _numAt changed to within primesUpTo
- Fixed a bug where primesUpTo(1, [2]) would return [2]