Add attribute to indicate entry point, #[main]

#4207

Functions marked with #[main] will take precedence over 'main' if it's there.