Split bugreport() into its own file and added unit tests.
am: 218e1ff759  -s ours

Change-Id: I2d0d2fcd60a7ceb0617d48a97cfa826c47830017