Fix #851: Build system support for models in subdirectories