Merge "Expose cmd's functionality as a static library." am: 47a389f2ac
am: a98ad027d0

Change-Id: I4fac23b8cbddc101f9e99ef9b1e81ab2e86e72a4