consolidate fputbytes
minor refactoring
switch parsing and evaluation to use Data.Text