adding support for specifying dns suffix for hostnames. Also doing

some refactoring to avoid custom decoding.