Done initial refactoring. Added simple tests. Does not fully work yet but getting there.
Moved old tests out of code directory and exclude them from installation.