Add extra unit tests and functional tests for CompositeViewEngine

Fixes #768