We present an integrated approach for supporting in-network sensor data processing in dynamic and heterogeneous sensor networks. The concept relies on data stream processing techniques that define and optimize the distribution of queries and their operators. We anticipate a high degree of dynamics and heterogeneity in the network, which is expected to be the case for wildlife monitoring applications. The distribution of operators to individual nodes demands several system level capabilities not available in current sensor node operating systems. In particular, we developed means for replacing software modules, i.e. small applications, on demand and without loss of status information. In order to facilitate this operation, we added a lightweight module support for the Nut/OS system and implemented a new memory management that uses tags for preserving state across module updates and node reboots.