add helpers for boost::variant

- get() gets value of variant if it contains a value of the specified type
- apply() applies function to variant if it contains a value of the specified type
add helper for boost::optional

fmap() takes optional value and functor and returns the mapped value by
the functor. If optional value doesn't contain value, it returns
boost::none.