Added test cases / requirements doc.
refactored in prep for tdd