fixed bug in ckDiffs (uint3 -> uint4), cleaned up javascript code
cleanup for jslint