Full refactor and new basic example. Adding licence and tests.