Moved stats commands into a different file and started writing overall framework for local stats.