The commit method now takes into account Context and will not commit if unit tests are being run.