"I will climb the mountain, then go to the river."
As 3d9y2 has said, the primary function of the ～て form is to join two verbs or two phrases to represent a relationship or a sequence. ～て does not mean a command by itself - ～てください is. It shows the verb before て and ください has a relationship (requesting the other party to do something).
It is important to note, by appearance, ～て form means a command, but actually not. It is because ください, which means "please could you give/do me," is omitted. (Much like わたしは is omitted from most of the sentences, or ありがとう which omits the ございます that follows for a complete sentence.)
After seeing this question multiple times, I've finally decided to post an answer. The て ending is not the imperative. The imperative forms are <sub>なさい、</sub>え、～ろう、and ～よう。 Get out! = 出て行け！出て行きなさい！ Eat! = 食べよう！食べなさい etc. ～て indicates incompletion. It means there's more to come. It is used to join the first verb to another verb for sort of a "compound verb" like 出て行く or 変えてくる or 返してください。(Notice the last one is the "polite command" you were talking about, which is an oxymoron in Japan. It's a request, not a command because imperatives are rude by nature.) It is also used to connect clauses together.
Grammatically, It actually could be either, but which one you use depends on your purpose for going.
It's true that に can be and is used for more specificity, emphasizing the destination (and purpose in having gone), while へ is a more generalizing particle, indicating emphasis on the journey to a destination, not necessarily with a purpose in mind.
Also, however, any へ can be replaced with に, but not every に can be replaced with へ.
The greatest weakness to Duolingo is that it doesn't give you specific direction as to what is most naturally spoken by a native to the language..