Context- and Terrain-Aware Gait Analysis and Activity Recognition