Moved solve() to cacheSolve.

Functionality unchanged.