Towards a practical framework for code offloading in the Internet of Things