Added testing framework (with IO obvious bugs)