Added external crate memstream as a cargo dependency and updated relevant files