Adding test and discovery package, commenting code and cleaning up. Also
added printout in JS format