Add cache(int capacity) to Observable

Proposed patch for #1303