Add encoding and docstring to grains package