refactor, move Accum into accum.go and start type-checking logic in typecheck.go