Separated lib an sample app. API refactoring.