Refactor wallet.rb, change wallet format to a unified json file