Move frame processing logic to separate function

This effectively removes 2 levels of indentation.
Fix alignment issues

Apparently, Qt has a nice function

  T qFromBigEndian(const uchar * src)

as well as the,

  T qFromBigEndian(T src)

The difference is the 2nd one requires properly aligned T, and the
first one reads it one byte at a time removing the alignment
constraints.