Fix a bug and do some tests

- bug in cacheSolve
- tests
- add sample for use of function