Move tray code to its own source file

Signed-off-by: Niklas Koep <niklas.koep@gmail.com>