Make engine more extendable

Changed method signature of methods that could sensibly be extended. Variables made protected as well.