Move private endpoint logic to v2 model

Separate v2 model code into the actual v2 model class. Introduce a v2
model test to exercise that code.