Initial commit of mg, based on mg-20140414

This has been taken directly from mg website.
Make code compilable using clens

This is caused by a dependency on strtonum that should be removed as
this is not portable.
Add .gitignore
Replace strtonum with strtol calls
Eliminate all the calls to strlcat

They are replaced by either strncat or sprintf calls.
Replace all the calls to unportable strlcpy with more generic things

This limits the dependency of this code with libbsd.
Remove use of unportable fgetln and replace it by getline from libc
Remove dependency to libbsd and rely completely on clens

libclens contains a version of fparseln as well.
Fix file name not printed correctly when opening it

This issue was introduced in 34c12b1.
Get correctly current working directory in getcwdir

Checks on the working directory size was done but no data was written
to result buffer.
Fix appending of slash when changing working dir

Instead of using an unreliable snprintf, add the slash manually and
terminate the path string.
Fix file insertion not able to fetch files from current work dir

This was triggered when using Ctrl-I to insert a file: process was using
files from root "/" and not current work dir as a base folder.
Use 4-space tabs