An Algebraic View of Inheritance and Subtyping in Object Oriented Programming