complete important functions in cgutils.js, add cgutils specification