Restructure register_user to reduce indentation

Rather than having a long if block with an else statement that just
returns an error, invert the if statements and return the error
immediately.  Significantly improves legibility of code.

Change-Id: I9400aea97dde7b7bce8328e78305efe3b7c4bdb8
Use check_output instead of Popen

When determining the libnemesis git revision, use check_output()
instead of Popen.  This reduces the code down, and also checks the
return value of the git comment (which was previously being ignored).

2014-02-16 Patch set 2: fix whitespace issues.

Change-Id: Id55bb3a9e0bf412038cba3d540521bcb975d6623