Extract class ref class definition

Minor changes only.
Add S3 method for a tab completion.