Major rewrite started: added class FrameSet and moved many free-floating
functions and some global variables into this class.

Introduced a phase angle for color.