Update and improve profiles format

- add profile version in the header
- change the profile format to a binary format (saves more than 50% of
space)
- improve error handling during parsing
- improve corner cases handling (all methods/classes in the
file)
- improve error reporting

Bug: 27600652
Bug: 27081617

(cherry picked from commit b8697b15145834c9861bebfb03daa745ecbe53e8)

Change-Id: Ia0a30e839eb11ada212bede34e4a2d556674219d
3 files changed