Added unittests for structures
fixed jslint warnings