For trails, get a larger front tire. It makes the world of a difference when going over obstacles at slow speeds.
To trackstand, have your arms fully extended, midsection above the handlebars, and turn the front wheel the opposite way of your front foot (ie. front foot is left, turn bars to right). You can try experimenting with foot positioning and where the cranks are positioned as well. Doesn't take long to learn once you have proper positioning. You don't 'need' to have the brakes locked, but I find it's better that way. I can do it for as long as I want now.
Learn
some of
these basic moves, and you'll be set.