AdaptiveScalarEncoder and test

Did some more changes to AdaptiveScalarEncoder and it's corresponding tests.