Hygiene: Move getOrigin method from mw.mobileFrontend to Api

* Update usage
* Styling fixes whilst there.

Change-Id: Ief1e6af11301638cae6dc142afab5d904d5b799a