Adding toJSON, fromJSON methods, fixing extra space in leading columns, adding documentation