oft: Move profiler setup/teardown to function

Profiler setup/teardown was done "in-situ". This was inconsistent
with the general design of 'oft'. Fix this, by moving these
operations to a seperate file.

In addition, add a '--profile-file' parameter, so that the output
file can be changed if necessary.

Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com>
oft: Rework to make more Pythonic

Rework some elements of oft to make them more "Pythonic".

Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com>