Restructure bugreporting script, not working yet