encoder: encode empty list as empty array
encoder: make string encoding cleaner
decoder: make returned values more consistent