Added extension mechanism and implemented simple_stats extension as an example