Sync process refactoring

Since it was hard to read ~200 LOC sync method, I've put some effort to refactor it so it my opinion it's easier to read & understand now. 
Also, now I make two different loops to apply Taric data and Chief data afterwards in separate transactions.
I've also changed few additional stuff, including tests so please take a look on that. (/cc @matthewford )