Add support for D mains functions
Fix flycheck mains