Add comments and docs to jat.lib