Large squashed commit with lot's of changes from Elite kernel. Bit thanks to Buckmarble for source and support.