got rid of eval

Was using eval for dynamic check of different types of conditions. This posed a threat with clients sending un-encoded URLs.
Also did some cleanup.