Beans factory: added more tests, use weak_<:<, support scala vars