allowing the entry point name to be something other than main

fixed #4207

giving a function the attribute `#[main]` makes the function main.

* if there is no function with `#[main]`, the function named 'main' will be the main.
* when `--test` is given, all function with `#[main]` will be stripped out and the main function for testing will be the only function having `#[main]` attribute.