Code merging

Merged code together, few modifications (mostly cleanup and removal of SD card functionality), added php scripts to repo as well.