Refactor code and set version 0.3.0 -- WARNING: Changes api a bit