Bug-22: Add Word and WordStorage class

@john-hu Please help me review this patch. Thank you.
If the code throws an exception, we will have two unclosed stream here. We have to use another try and finally to close output and input.