Fix some bugs in iql.js and write some iql docs.