Fix getitem and add string APIs for each class and add usage for format.
Also added comments.