Default [Q] Making a anti-theft system

My only worry if someone steals my phone is someone messing with my data. Passwords and MTP is already good enough for the dumb thiefs, and very tech-savvy ones are nearly impossible to stop, but I still want to create a barrier which needs work to break.

What I want to create:

- Human being steal my phone;
- I sent some code (probably SMS);
- My phone make a backup and erase the ROM and recovery afterwards;
- Advanced: flash a "tracking" ROM so I can search it.

Any ideas how to do it?