Make the casting functions non virtual and do as cast based on type

This saves subclasses from having to reimplement 1 function, but gives
slightly less flexibility (allthough probably imaginative)