Add comments and docs to jat.lib
Add comments and docs to jat.lib