Serialize decimal fields as number and changes the type of all 'code' fields to string

closes #73 
is value defined twice here?