Adding tests and some enhancements.

Signed-off-by: David Marques <dpsmarques@gmail.com>