Avoid second []byte -> string conversion

[]byte -> string conversions are expensive as they will copy and
generate garbage. Avoid the second one by leveraging the fact that
strings are immutable in Go.
simplify if expressions with switch cases

in order to provide better extensability and avoid code duplication.
Avoid useless conversion

`val` is already of type string. Converting it againt will just hide
errors.
use string constants instead of strings

in order to to leverage the compiler to find typos and assist the user
providing code completion for this.
Merge pull request #8 from nightlyone/some_performance_improvements

Thanks, all are very nice ones!
Feel free to give me more pull request if you find more improvement.