Improve CLI transaction history + fix wallet opening error + lots of cleanup

* enhance cli transaction history
* fix wallet file loading error
* fixed some compiler warnings
* lots of miscellaneous cleanup and minor bugfixes