gen: factored out generic slice generation.

Semantics of when to use arrays or slices is preserved.

Changed type of M49 codes to int to ensure they will be printed
in decimal format, instead of hex.

Change-Id: Ic4f3b5b4a9a89eb3c3730a65ee4bac9810d0c3ae
Reviewed-on: https://go-review.googlesource.com/13856
Reviewed-by: Nigel Tao <nigeltao@golang.org>
5 files changed