Bug fixes, cleaned up code

Getting ready to implement transcoding of moviefiles