Moved caching logic to libmarquise, also corrected a success check in em...

...it_bytes