moved guaranteeEvents(..) to a separate node module + some fixes formats.js and testing...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>