Bug 840147 & Bug 877903 : fix orientation problem on open/close app animation.

This is for v1-train only patch.
Mostly the same logic as @98e70417ca684d26052768511e6a347a319c0991, with the following need to be noticed:
- CSS rules differs significantly to adapt the legacy open/close app animation on v1-train.
- App-to-app transition doesn't need any fix in master with respect to orientation, but seems it's not so good in v1-train. I'm not sure if we have any plan uplifting new app-to-app transition. 
- Apps setting their orientation as "landscape" rather than "landscape-primary" or "landscape-secondary" will be opened in landscape-primary by default now.