Add if defined around MySQL backend include
Implement backend factory shutdown and added test for it
Added more unit tests