Stats support

Added stats support, cleanup done ( unused imports mostly )