Base changes

This lays the groundwork for the new JHM implementation (PR for that shortly).

Adds / cleans up a number of different utility functions in \<base>
Would prefer:

```cpp
bool Jhm::EndsWith(const TExtension &full_ext, const TExtension &tail) {
  if (full_ext.size() < tail.size()) {
    return false;
  }
  return std::equal(std::begin(tail),
                    std::end(tail),
                    std::end(full_ext) - tail.size());
}
```