[SPARK-1337] Garbage collect the oldest stages in the ui instead of the newest

Fix for SPARK-1337. Basically remove elements from the beginning (oldest) rather than the end (newest) of the stages list. Added some tests for basic correctness as well.