Restructure "tune" module

Does not compile yet because of dependencies...