Factorize IPython user_ns management in Models