Improvements to the transcoder

All of these changes except the first have to do with improving the transcoder in some manner. Please refer to the commit messages for more information.