Merging sms_tools branch, more modular & general purpose cool