Style/clarity changes

Use more idiomatic python constructs/project house style for
string interpolation: new style str.format versus %, use
str.startswith instead of slice+string comparison.