A unified theory of thermoviscoplasticity of crystalline solids