Inner class name js 352

I've resolved second problem from #352 (generic parameter) and added some sort of test for both problems. I'm not very happy with tests, but it is better then nothing.