refactor context related functions into context.c

Signed-off-by: Andy Green <andy.green@linaro.org>
4 files changed