[ecloud] Added mock support and also some bug fixes/improvements.