move writer node class hierarchy into writer companion object, remove context type alias