Added @reference and @main helpers
Added more tests