generalized encoding

allow specifying specific encoding settings per domain
set up tox