Clean up AppDelegate initialisation

Added AllowNullLiteral to BasketButton so it can be assigned null value.
Changed initialisation order so everything is safely done in
FinishedLoading.
Removed recursive type definition (as this) from the AppDelegate this
avoids unnecessary runtime checks.
Converted members into local let functions.