Some NULL pointer safety

Signed-off-by: Rick Taylor <rick@tropicalstormsoftware.com>
A load of syntax line handling and the start of if

Signed-off-by: Rick Taylor <rick@tropicalstormsoftware.com>
More dead-code removal, and some debug printf

Signed-off-by: Rick Taylor <rick@tropicalstormsoftware.com>