Minor but free performance improvements

Change *substr()* to *strpos()* where applicable for a free memory performance improvement

![image](https://cloud.githubusercontent.com/assets/1324566/3894501/f3eb7d38-2244-11e4-913c-eeea9f1ca6c9.png)