Fixed version line.
Changed title function to return a value instead of echo it. Makes it easier to unit test.