Add class wrapper to be able to deals with multiple context

This is a major enhancement and refactor. It aims to wrap all code into a reusable class. I keep the current interface unchanged for backward compatibility reason.

JM.