add a FlattenTable module

Hey guys,

This is a module that I've found super useful over the past year (so I figured I would do a PR).  It takes a nested table as input and outputs a flattened table.  It does not do any copies and it creates the flattened table only if the input table references, or the table structure itself changes.  The same check happens during BPROP to avoid the lua garbage collector.

It's really nice when you want a module that takes in a input table, does some complicated stuff then outputs a table with the new tensor appended to the input tensor:

Here's a pseudo-code example:

m = nn.Sequential()
par = nn.ConcatTable()
par:add(nn.Identity())
par:add(<module that takes in the table and outputs T_o tensor>)
m:add(par)
m:add(nn.FlattenTable())  -- Output is a table with {T1, T2, ...., Tn, T_o}