Refactor in-app billing to be clearer, more fault tolerant and have better logging