Formatting and streamlining

Removed hasObject, instead using null tests
Indentation fixed in all files.