do not remove external constants, fixes #1722
ignore JRuby ObjectSpace setting
add tests for #1723
Merge pull request #1723 from padrino/external-const

do not remove external constants, fixes #1722