get rid of all these nasty object literals in favor of a more functional approach. very lightweight, inspired by benjamn/ast-types