Abtesting refactor

These changes include all the feature requests that are required in order to start the first A/B testing this year.

@nefretete @gabrys @Wyvek Please review the changes.