optimize and fix storage

1. use break to speed up the loop
2. storage support plain object
Merge pull request #2 from numbbbbb/master

optimize and fix storage