Fix whitespace issues.
Add definitions of top-level declarations.
Add constructors for top-level declarations.
Add extra types for sources, triggers and sinks.
Add declarations to build file.