Squid: Avoid cycle between java packages

https://trello.com/c/A0rrIWb0

Resolved packages dependency cycles in MOTECH Appointments API
* Moved VisitsQuery from service.contract to server
* Moved appropriate tests to fit the new packages order

Change-Id: Ia6061940f6d62fc64d3ff046816f7cb5c752564b