Added object-oriented api

Doesn't break the old API :)