more fixups - runs on darwin now too
refactor decoders into own classes cleanup code a bit