AccountService: Implements fix unit tests. Updates sort code
Merging latest failsafe branch changes