BUG-987: improve generated type allocation

This patch improves ArrayList allocation such it does not waste space in
generated types, since we know how big an array we need before hand. We
also use singletonList() and emptyList() as appropriate. Shaves off
about 2MB from retained size on a vanilla SP edition.

Change-Id: Ief18a029613f14c13abc985aa60388b704bae79e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Merge "BUG-987: improve generated type allocation"