JSONAlchemy: bug fixes and tests improvements

Signed-off-by: Esteban J. G. Gabancho <esteban.gabancho@gmail.com>