Add unit tests, refactor political data loading