Interface changes

Trying to use "const Type&" where possible. In general use reference
where NULL is not a valid argument and no pointer arithmetic is needed.