Add tests and refactors for Wikia