Improved script processor

Rewritten script processor for additional functionality.  Now handles
more than 3 script segments plus supports additional script opcodes.