Format Fixes

Fixed the format function and added the ability to format and tokenize
lines.