Added autowiring and autodiscovery stuff.