agent: added utility functions to marshal/unmarshal tags
command: replaced duplicated tag marshalling/unmarshalling rules with calls to the new utility functions
agent: added tests for tag marshalling functions
Merge pull request #190 from ryanuber/e-tagmarshal

agent: tag marshalling functions