Unify and refactor the way we get and use platform info

@umop This is a preparatory step towards breaking the circular dependency between the app and the UI. It also unifies several fragmented ways we used to get to the platform info.