Added S4 class and the simplest methods.