Test suite

Same content as old tests but runnable via nose and with assertions.