formatting tweaks.
moved code to its own files.
fixed assertion when binding a color source to a scalar input, plus some refactorings.