add memory pool impl, handle various little details, add beginnings of mimelib