Fixed three bugs causing redundant remove and append

1. When checking overlimit,  should take margin into consideration.

2. Fixed a bug in findRowMax,  should only use edge of last item in that row.

3. appendItems should check overlimit before add item when oneColumnMode is
   false, both withcache and withoutcache.

Also added test case for move items

Bug: 19017080

Change-Id: I6594c9158b186449739eb284c4607df7803e2049
7 files changed