more gradient tests
make error message more clear
add @function, @gradient decorators