Made some of the value term parsing code more resilient
Made some of the value term parsing code more resilient

paulbdavis/ledger,afh/ledger,jwakely/ledger,duncanmortimer/ledger,paulbdavis/ledger,jwakely/ledger,duncanmortimer/ledger,ledger/ledger,paulbdavis/ledger,paulbdavis/ledger,duncanmortimer/ledger,ledger/ledger,jwakely/ledger,afh/ledger,paulbdavis/ledger,jwakely/ledger,jwakely/ledger,ledger/ledger,jwakely/ledger,ledger/ledger,afh/ledger,duncanmortimer/ledger,duncanmortimer/ledger,afh/ledger,afh/ledger,duncanmortimer/ledger,paulbdavis/ledger,paulbdavis/ledger,ledger/ledger,jwakely/ledger,duncanmortimer/ledger