Moved expression building into TypeSerializer. Fixes #3.