Template result

Move the code to use a templated result so that we can use a smaller number of QObjects and work around certain moc limitations.