DO NOT MERGE: Split bugreport() into its own file and added unit tests.
am: 698e065e14  -s ours

Change-Id: Iebbdfef75e812db2d2252f50055b6df626ce05d6