Added an clean alternative to monkey patching.

Refactored the code to remove monkey patching but I've kept the old code for backward compatibility. It provides cleaner interface. Previously, you have to use both CommonLogger and AccessLogger to make json logging work.