Move generic stuff to base module; almost working clio statplanet