Nonmodular architectures of cognitive systems based on active inference