Refactored

Now offered as a library + sample apk