Moving python interface to core sources (this needs work here as well)