Add infer using argument annotations
Fix scope handling of returns and arguments
Put code in proper module