Feature/unit tests

@emhr This is a start, try it out and say what you think.