Added flattenObject method

original code from https://gist.github.com/penguinboy/762197
Added documentation
added missing dependency - glob (tests failing)
Added unit tests + related fix
Added compiled files