Cache has basic functionality
Fixed a bug that stops all but the first encode session. Fixed a bug that incorrecly handled encodes.