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

Change-Id: I0ae6ba38b62f714895e8d9abb5b36c5d8a82c6f2