Added basic S4 functions, minor fixes left, #26