receipts: fall back to localStorage (bug 1021918)

@mstriemer r?
I have a couple tests for it. Also, I think indexOf is pretty fast in JS now. We can try to optimize it later if needed