Refacored encoding logic to be less nightmare-ish.
minor rename of struct
tags encoded in increasing order, log.Fatl instead of panic