core/misc: Collection of misc. functions

Signed-off-by: Gergely Nagy <algernon@balabit.hu>