Move session.py to core package