Add generic support to CF build; fixes #327

This PR ports generic support to CF using fixes created by Neil in his Crestron build. Any further problems with this feature should have new issues created so we can work them in priority order.
Agreed. The extension of course is Neil's code. AFAIK there isn't a unit test. Do you think we need it before merging?