Split bugreport() into its own file and added unit tests. am: 78e0963e4b
am: 5c01124f37

Change-Id: I2522ca63ee339b19cb05fc2728fb54499f3dae35