metaprogramming utilities in separate header, add meta_apply, use it in a few places to avoid awful typename::type idiom