Nearly complete rewrite of cgpt tool.

This fixes a number of bugs, adds a bunch of commands, and essentially makes
cgpt ready to use as a replacement for gpt. Still to do is to add commands
and options that will let it generated intentionally bad partitions, for use
in testing.

Review URL: http://codereview.chromium.org/2719008
diff --git a/tests/common.sh b/tests/common.sh
index 421f629..6afcd77 100755
--- a/tests/common.sh
+++ b/tests/common.sh
@@ -30,10 +30,21 @@
 hash_algos=( sha1 sha256 sha512 )
 key_lengths=( 1024 2048 4096 8192 ) 
 
-function check_test_keys {
-  if [ ! -d ${TESTKEY_DIR} ]
-  then
-    echo "You must run gen_test_keys.sh to generate test keys first."
-    exit 1
-  fi
+function happy {
+  echo -e "${COL_GREEN}$*${COL_STOP}" 1>&2
 }
+
+function warning {
+  echo -e "${COL_YELLOW}WARNING: $*${COL_STOP}" 1>&2
+}
+
+function error {
+  echo -e "${COL_RED}ERROR: $*${COL_STOP}" 1>&2
+  exit 1
+}
+
+function check_test_keys {
+  [ -d ${TESTKEY_DIR} ] || \
+    error "You must run gen_test_keys.sh to generate test keys first."
+}
+