Feature tests

Add some more extensive testing to the python part, fixes some bugs and pylint errors too.