Major changes to the api which simplified a bunch of stuff (removed almost 700 loc). Added common-lang dependency