Fix epics seq
The latest update to the epics sequencer broke regular models as some CA_SDF code was not guarded by ifdefs. Move the code to functions and simplify the ifdefs.
This also cleans up two unrelated initialization and function return issues.