[PlatformWithOS] Reorganisation support: Raspberry Pi + Beagle Bone Black

Reorganise and factor out common code so as to support
compilation on Raspberry Pi and Beagle Bone Black

NOTE: Beagle Bone Black is still under testing, so beware!
      Only being tested on Beagle Bone Black Angstrom
      booted from micro SD card.

Signed-off-by: Christopher Hall <christopherhall.hsw@gmail.com>