Human Localization and Activity Recognition Using Distributed Motion Sensors