Cleaning and new session through JS (WIP). related to #17