Move meminfo code and header to lib/

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>