Performance based improvements and test cases v2

Performance improvements & loops entire string as defined by length/desire in the top comment in sds.c