Use a better User-Agent parser

This replaces the current UA parser with a stripped down version of
<https://github.com/tobie/ua-parser>'s PHP port.

Change-Id: Ife6ec6181eb78461d719a54a7476260e9b7e175a
Merge "Use a better User-Agent parser"