Updated Scaladoc and test cases for chapter 1 to 5