Couple of patches to make Robolectric happy

Main issue is LayoutInflater not properly initialised, maybe this could be solved with Robolectric's custom class loaders or something.