make q usable in node
add missing semicolons
add tests