Major refactoring (move callbacks into preview activity).

Thanks a lot @Sloy ! (https://github.com/Sloy)