ij review: write and use a set of string parsing functions

Signed-off-by: David Scott <dave.scott@citrix.com>