Sorting order of new cards

Fix for [Issue1354](http://code.google.com/p/ankidroid/issues/detail?id=1354)

I implemented the missing parts of libanki which was simple enough. It turns out sorting is quite slow so I ended up showing a progress dialog when re-sorting is being done. I hope I did that right. DeckTask was a little overwhelming, but it's starting to make some sense now. I mainly copied from other parts that were doing a similar thing.

Sorting ~7500 new cards on my phone takes about 45 seconds and on my tablet around 5 seconds. With a debugger attached, it's 3+ minutes on the tablet, which I found a little surprising (perhaps a clue to a performance issue?).