Security Token feature fixed

Policy module was generating the JSON manually and tests were failing.
Tests also working now.