diff --git a/sigil/common/core/sigil.properties b/sigil/common/core/sigil.properties
index d475031..0d741b9 100644
--- a/sigil/common/core/sigil.properties
+++ b/sigil/common/core/sigil.properties
@@ -29,7 +29,6 @@
 	org.apache.felix.sigil.core.licence, \
 	org.apache.felix.sigil.core.repository, \
 	org.apache.felix.sigil.model, \
-	org.apache.felix.sigil.model.common, \
 	org.apache.felix.sigil.model.eclipse, \
 	org.apache.felix.sigil.model.osgi, \
 	org.apache.felix.sigil.repository, \
@@ -37,12 +36,12 @@
 -imports: \
 	aQute.lib.osgi, \
 	org.apache.felix.sigil.bnd, \
+	org.apache.felix.sigil.common.osgi, \
 	org.apache.felix.sigil.config, \
 	org.apache.felix.sigil.core, \
 	org.apache.felix.sigil.core.licence, \
 	org.apache.felix.sigil.core.repository, \
 	org.apache.felix.sigil.model, \
-	org.apache.felix.sigil.model.common, \
 	org.apache.felix.sigil.model.eclipse, \
 	org.apache.felix.sigil.model.osgi, \
 	org.apache.felix.sigil.repository, \
diff --git a/sigil/common/core/src/org/apache/felix/sigil/bnd/BundleBuilder.java b/sigil/common/core/src/org/apache/felix/sigil/bnd/BundleBuilder.java
index 39b0137..a89c99f 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/bnd/BundleBuilder.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/bnd/BundleBuilder.java
@@ -33,11 +33,11 @@
 import java.util.Set;
 import java.util.jar.Attributes;
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.config.BldAttr;
 import org.apache.felix.sigil.config.IBldProject;
 import org.apache.felix.sigil.config.IBldProject.IBldBundle;
 import org.apache.felix.sigil.core.repository.SystemRepositoryProvider;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.osgi.IPackageExport;
 import org.apache.felix.sigil.model.osgi.IPackageImport;
 import org.apache.felix.sigil.model.osgi.IRequiredBundle;
diff --git a/sigil/common/core/src/org/apache/felix/sigil/config/BldConverter.java b/sigil/common/core/src/org/apache/felix/sigil/config/BldConverter.java
index 7a26cb7..dcfde4b 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/config/BldConverter.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/config/BldConverter.java
@@ -31,11 +31,11 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.config.IBldProject.IBldBundle;
 import org.apache.felix.sigil.core.BldCore;
 import org.apache.felix.sigil.core.internal.model.eclipse.SigilBundle;
 import org.apache.felix.sigil.core.internal.model.osgi.BundleModelElement;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.eclipse.ISigilBundle;
 import org.apache.felix.sigil.model.osgi.IBundleModelElement;
 import org.apache.felix.sigil.model.osgi.IPackageExport;
diff --git a/sigil/common/core/src/org/apache/felix/sigil/config/BldProject.java b/sigil/common/core/src/org/apache/felix/sigil/config/BldProject.java
index 9b1a445..e2f3556 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/config/BldProject.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/config/BldProject.java
@@ -42,12 +42,12 @@
 import java.util.Properties;
 import java.util.TreeSet;
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.core.internal.model.osgi.BundleModelElement;
 import org.apache.felix.sigil.core.internal.model.osgi.PackageExport;
 import org.apache.felix.sigil.core.internal.model.osgi.PackageImport;
 import org.apache.felix.sigil.core.internal.model.osgi.RequiredBundle;
 import org.apache.felix.sigil.model.IModelElement;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.eclipse.ISigilBundle;
 import org.apache.felix.sigil.model.osgi.IBundleModelElement;
 import org.apache.felix.sigil.model.osgi.IPackageExport;
diff --git a/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/eclipse/LibraryImport.java b/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/eclipse/LibraryImport.java
index 2c48601..d8ef81d 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/eclipse/LibraryImport.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/eclipse/LibraryImport.java
@@ -20,8 +20,8 @@
 package org.apache.felix.sigil.core.internal.model.eclipse;
 
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.model.AbstractModelElement;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.eclipse.ILibraryImport;
 
 
diff --git a/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/osgi/PackageImport.java b/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/osgi/PackageImport.java
index adf6314..f6cfdaf 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/osgi/PackageImport.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/osgi/PackageImport.java
@@ -20,10 +20,10 @@
 package org.apache.felix.sigil.core.internal.model.osgi;
 
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.model.AbstractModelElement;
 import org.apache.felix.sigil.model.IModelElement;
 import org.apache.felix.sigil.model.InvalidModelException;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.osgi.IPackageExport;
 import org.apache.felix.sigil.model.osgi.IPackageImport;
 
diff --git a/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/osgi/RequiredBundle.java b/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/osgi/RequiredBundle.java
index af41438..3cd7aa8 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/osgi/RequiredBundle.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/core/internal/model/osgi/RequiredBundle.java
@@ -20,9 +20,9 @@
 package org.apache.felix.sigil.core.internal.model.osgi;
 
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.model.AbstractModelElement;
 import org.apache.felix.sigil.model.IModelElement;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.osgi.IBundleModelElement;
 import org.apache.felix.sigil.model.osgi.IRequiredBundle;
 
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/And.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/And.java
deleted file mode 100644
index 9e1bc0a..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/And.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-import java.util.Map;
-
-
-public class And implements LDAPExpr
-{
-
-    /**
-     */
-    private static final long serialVersionUID = 1L;
-    private LDAPExpr[] children;
-
-
-    public static LDAPExpr apply( LDAPExpr... terms )
-    {
-        if ( terms == null )
-        {
-            throw new NullPointerException( "terms cannot be null" );
-        }
-        else if ( terms.length == 0 )
-        {
-            return Expressions.T;
-        }
-        else if ( terms.length == 1 )
-        {
-            return terms[0];
-        }
-        LDAPExpr[] filtered = new LDAPExpr[terms.length];
-        int ctr = 0;
-        for ( int i = 0; i < terms.length; i++ )
-        {
-            if ( terms[i].equals( Expressions.F ) )
-                return Expressions.F;
-            if ( terms[i].equals( Expressions.T ) )
-                continue;
-            filtered[ctr] = terms[i];
-            ctr++;
-        }
-        if ( ctr == 0 )
-        {
-            return Expressions.T;
-        }
-        else if ( ctr == 1 )
-        {
-            return filtered[0];
-        }
-        LDAPExpr[] andTerms = new LDAPExpr[ctr];
-        System.arraycopy( filtered, 0, andTerms, 0, ctr );
-
-        return new And( andTerms );
-    }
-
-
-    private And( LDAPExpr... children )
-    {
-        this.children = children;
-    }
-
-
-    public boolean eval( Map<String, ?> map )
-    {
-        for ( int i = 0; i < children.length; i++ )
-        {
-            if ( !children[i].eval( map ) )
-            {
-                return false;
-            }
-        }
-        return true;
-    }
-
-
-    public void visit( ExprVisitor v )
-    {
-        v.visitAnd( this );
-    }
-
-
-    public LDAPExpr[] getChildren()
-    {
-        return children;
-    }
-
-
-    public void setChildren( LDAPExpr[] children )
-    {
-        this.children = children;
-    }
-
-
-    @Override
-    public boolean equals( Object other )
-    {
-        if ( other instanceof And )
-        {
-            And that = ( And ) other;
-            if ( children.length != that.children.length )
-            {
-                return false;
-            }
-            for ( int i = 0; i < children.length; i++ )
-            {
-                if ( !children[i].equals( that.children[i] ) )
-                {
-                    return false;
-                }
-            }
-            return true;
-        }
-        return false;
-    }
-
-
-    @Override
-    public String toString()
-    {
-        StringBuffer buf = new StringBuffer( 256 );
-        buf.append( "(&" );
-        for ( int i = 0; i < children.length; i++ )
-        {
-            buf.append( " " ).append( children[i] ).append( " " );
-        }
-        buf.append( ")" );
-        return buf.toString();
-    }
-
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/Cardinality.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/Cardinality.java
deleted file mode 100644
index 07220cc..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/Cardinality.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-import java.io.Serializable;
-
-
-/**
- * Immutable class representing cardinality constraints between two entities.
- * 
- */
-public class Cardinality implements Serializable
-{
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-    public static final Cardinality ZERO_TO_MANY = new Cardinality( 0, -1 );
-    public static final Cardinality ONE_TO_MANY = new Cardinality( 1, -1 );
-    public static final Cardinality ZERO_TO_ONE = new Cardinality( 0, 1 );
-    public static final Cardinality ONE_TO_ONE = new Cardinality( 1, 1 );
-
-    private int min;
-    private int max;
-
-
-    /**
-     * @param min
-     *            >=0 (usually 0 or 1)
-     * @param max
-     *            >=min or -1 to indicate an unbounded maximum
-     */
-    public Cardinality( int min, int max )
-    {
-        if ( min < 0 )
-        {
-            throw new IllegalArgumentException( "Min cannot be less than 0" );
-        }
-
-        if ( ( max < min ) && ( max != -1 ) )
-        {
-            throw new IllegalArgumentException( "Max cannot be less than min" );
-        }
-
-        this.min = min;
-        this.max = max;
-    }
-
-
-    public int getMin()
-    {
-        return min;
-    }
-
-
-    public int getMax()
-    {
-        return max;
-    }
-
-
-    public String toString()
-    {
-        return min + ".." + ( ( max == -1 ) ? ( "n" ) : ( Integer.toString( max ) ) );
-    }
-
-
-    public boolean isDefined( Cardinality cardinality )
-    {
-        return ( min <= cardinality.min ) && ( ( max == -1 ) || ( max >= cardinality.max ) );
-    }
-
-
-    public boolean isSingleton()
-    {
-        return ( min == 1 ) && ( max == 1 );
-    }
-
-
-    public static Cardinality parse( String stringRep ) throws IllegalArgumentException
-    {
-        stringRep = stringRep.trim();
-
-        int dotdot = stringRep.indexOf( ".." );
-
-        if ( dotdot == -1 )
-        {
-            throw new IllegalArgumentException( "Invalid cardinality string representation, expected .." );
-        }
-
-        String minStr = stringRep.substring( 0, dotdot );
-        String maxStr = stringRep.substring( dotdot + 2 );
-
-        int min = Integer.parseInt( minStr );
-        int max = min;
-
-        if ( "n".equals( maxStr ) )
-        {
-            max = -1;
-        }
-        else
-        {
-            max = Integer.parseInt( maxStr );
-        }
-
-        return cardinality( min, max );
-    }
-
-
-    public static Cardinality cardinality( int min, int max )
-    {
-        Cardinality c = null;
-
-        if ( min == 0 )
-        {
-            if ( max == 1 )
-            {
-                c = ZERO_TO_ONE;
-            }
-            else if ( max == -1 )
-            {
-                c = ZERO_TO_MANY;
-            }
-        }
-        else if ( min == 1 )
-        {
-            if ( max == 1 )
-            {
-                c = ONE_TO_ONE;
-            }
-            else if ( max == -1 )
-            {
-                c = ONE_TO_MANY;
-            }
-        }
-
-        if ( c == null )
-            c = new Cardinality( min, max );
-
-        return c;
-    }
-
-
-    public int hashCode()
-    {
-        return max ^ min;
-    }
-
-
-    public boolean equals( Object o )
-    {
-        if ( o == this )
-        {
-            return true;
-        }
-
-        if ( o == null )
-        {
-            return false;
-        }
-
-        try
-        {
-            Cardinality c = ( Cardinality ) o;
-
-            return ( min == c.min ) && ( max == c.max );
-        }
-        catch ( ClassCastException cce )
-        {
-            return false;
-        }
-    }
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/ExprVisitor.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/ExprVisitor.java
deleted file mode 100644
index 4a1b95c..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/ExprVisitor.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-public interface ExprVisitor
-{
-
-    void visitAnd( And a );
-
-
-    void visitOr( Or o );
-
-
-    void visitNot( Not n );
-
-
-    void visitSimple( SimpleTerm st );
-
-
-    // if none of the above matches use this
-    void visitAny( LDAPExpr ex );
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/Expressions.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/Expressions.java
deleted file mode 100644
index 976d4b5..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/Expressions.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-import java.util.Map;
-
-
-public class Expressions
-{
-
-    public static LDAPExpr and( LDAPExpr... terms )
-    {
-        return And.apply( terms );
-    }
-
-
-    public static LDAPExpr or( LDAPExpr... terms )
-    {
-        return Or.apply( terms );
-    }
-
-
-    public static LDAPExpr not( LDAPExpr e )
-    {
-        return Not.apply( e );
-    }
-
-    public static LDAPExpr T = Bool.TRUE;
-    public static LDAPExpr F = Bool.FALSE;
-
-
-    // supports direct use of wildcards for ease of testing, but not literal *s
-    public static SimpleTerm ex( String name, Ops op, String rhs )
-    {
-
-        rhs = rhs.replace( '*', SimpleTerm.WILDCARD );
-        return new SimpleTerm( name, op, rhs );
-    }
-
-}
-
-class Bool implements LDAPExpr
-{
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-    public static final Bool TRUE = new Bool( true );
-    public static final Bool FALSE = new Bool( false );
-
-    private boolean bool;
-
-
-    public Bool( boolean bool )
-    {
-        this.bool = bool;
-    }
-
-
-    public boolean eval( Map<String, ?> map )
-    {
-        return bool;
-    }
-
-
-    public void visit( ExprVisitor v )
-    {
-    }
-
-
-    public LDAPExpr[] getChildren()
-    {
-        return CHILDLESS;
-    }
-
-
-    public String toString()
-    {
-        return "(" + bool + ")";
-    }
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/FilterValidator.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/FilterValidator.java
deleted file mode 100644
index a5bbb1d..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/FilterValidator.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-public interface FilterValidator
-{
-
-    public static FilterValidator ACCEPT_ALL = new AcceptEverythingValidator();
-
-
-    boolean validate( LDAPExpr filter );
-
-    static class AcceptEverythingValidator implements FilterValidator
-    {
-
-        public boolean validate( LDAPExpr filter )
-        {
-            return true;
-        }
-
-    }
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/LDAPExpr.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/LDAPExpr.java
deleted file mode 100644
index 8e9214c..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/LDAPExpr.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-import java.io.Serializable;
-import java.util.Map;
-
-
-public interface LDAPExpr extends Serializable
-{
-
-    public static final LDAPExpr[] CHILDLESS = new LDAPExpr[]
-        {};
-    public static LDAPExpr ACCEPT_ALL = Expressions.T;
-
-
-    LDAPExpr[] getChildren();
-
-
-    void visit( ExprVisitor v );
-
-
-    boolean equals( Object other );
-
-
-    int hashCode();
-
-
-    boolean eval( Map<String, ?> map );
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/LDAPParseException.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/LDAPParseException.java
deleted file mode 100644
index b72aa2f..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/LDAPParseException.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-public class LDAPParseException extends Exception
-{
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-
-    private ParseState ps;
-    private static final String LINE_SEPARATOR = System.getProperty( "line.separator", "\\r\\n" );
-
-
-    public LDAPParseException( String message, ParseState ps )
-    {
-        super( message );
-        this.ps = ps;
-    }
-
-
-    public LDAPParseException( String message )
-    {
-        super( message );
-    }
-
-
-    @Override
-    public String getMessage()
-    {
-        if ( ps == null )
-        {
-            return super.getMessage();
-        }
-
-        String basicMessage = super.getMessage();
-        StringBuffer buf = new StringBuffer( basicMessage.length() + ps.str.length() * 2 );
-        buf.append( basicMessage ).append( LINE_SEPARATOR );
-        buf.append( ps.str ).append( LINE_SEPARATOR );
-        for ( int i = 0; i < ps.pos; i++ )
-        {
-            buf.append( " " );
-        }
-        buf.append( "^" );
-        return buf.toString();
-    }
-
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/LDAPParser.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/LDAPParser.java
deleted file mode 100644
index 98b4bda..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/LDAPParser.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-import static org.apache.felix.sigil.model.common.Expressions.and;
-import static org.apache.felix.sigil.model.common.Expressions.not;
-import static org.apache.felix.sigil.model.common.Expressions.or;
-import static org.apache.felix.sigil.model.common.Ops.APPROX;
-import static org.apache.felix.sigil.model.common.Ops.EQ;
-import static org.apache.felix.sigil.model.common.Ops.GE;
-import static org.apache.felix.sigil.model.common.Ops.GT;
-import static org.apache.felix.sigil.model.common.Ops.LE;
-import static org.apache.felix.sigil.model.common.Ops.LT;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-public class LDAPParser
-{
-
-    private static final LDAPParser parser = new LDAPParser();
-
-
-    public static LDAPExpr parseExpression( String strExpr ) throws LDAPParseException
-    {
-        return parser.parse( strExpr );
-    }
-
-
-    public static void main( String[] args )
-    {
-        for ( String arg : args )
-        {
-            try
-            {
-                System.out.println( parseExpression( arg ) );
-            }
-            catch ( LDAPParseException e )
-            {
-                System.out.println( "Failed to parse " + arg );
-                e.printStackTrace();
-            }
-        }
-    }
-
-
-    public LDAPExpr parse( String strExpr ) throws LDAPParseException
-    {
-
-        if ( strExpr == null || strExpr.trim().length() == 0 )
-        {
-            return LDAPExpr.ACCEPT_ALL;
-        }
-
-        ParseState ps = new ParseState( strExpr );
-        LDAPExpr expr = parseExpr( ps );
-        ps.skipWhitespace();
-        if ( !ps.isEndOfString() )
-        {
-            error( "expected end of expression ", ps );
-        }
-        return expr;
-    }
-
-
-    public LDAPExpr parseExpr( ParseState ps ) throws LDAPParseException
-    {
-        ps.skipWhitespace();
-        if ( !( ps.peek() == '(' ) )
-        {
-            error( "expected (", ps );
-        }
-        ps.read();
-        LDAPExpr expr = null;
-        ps.skipWhitespace();
-        char ch = ps.peek();
-        switch ( ch )
-        {
-            case '&':
-                ps.readAndSkipWhiteSpace();
-                List<LDAPExpr> andList = new ArrayList<LDAPExpr>();
-                while ( ps.peek() == '(' )
-                {
-                    andList.add( parseExpr( ps ) );
-                    ps.skipWhitespace();
-                }
-                LDAPExpr[] andArr = andList.toArray( new LDAPExpr[andList.size()] );
-                expr = and( andArr );
-                break;
-            case '|':
-                ps.readAndSkipWhiteSpace();
-                List<LDAPExpr> orList = new ArrayList<LDAPExpr>();
-                while ( ps.peek() == '(' )
-                {
-                    orList.add( parseExpr( ps ) );
-                    ps.skipWhitespace();
-                }
-                LDAPExpr[] orArray = orList.toArray( new LDAPExpr[orList.size()] );
-                expr = or( orArray );
-                break;
-            case '!':
-                ps.readAndSkipWhiteSpace();
-                expr = not( parseExpr( ps ) );
-                break;
-            default:
-                if ( isNameChar( ch ) )
-                {
-                    expr = parseSimple( ps );
-                }
-                else
-                {
-                    error( "unexpected character: '" + ch + "'", ps );
-                }
-        }
-        ps.skipWhitespace();
-        if ( ps.peek() != ')' )
-        {
-            error( "expected )", ps );
-        }
-        ps.read();
-        return expr;
-
-    }
-
-
-    void error( String message, ParseState ps ) throws LDAPParseException
-    {
-        throw new LDAPParseException( message, ps );
-    }
-
-
-    private SimpleTerm parseSimple( ParseState ps ) throws LDAPParseException
-    {
-        // read name
-        StringBuffer name = new StringBuffer( 16 );
-        for ( char c = ps.peek(); !ps.isEndOfString() && isNameChar( c ); c = ps.peek() )
-        {
-            ps.read();
-            name.append( c );
-        }
-        ps.skipWhitespace();
-        Ops op = null;
-        // read op
-        if ( ps.lookingAt( "=" ) )
-        {
-            op = EQ;
-            ps.skip( 1 );
-        }
-        else if ( ps.lookingAt( ">=" ) )
-        {
-            op = GE;
-            ps.skip( 2 );
-        }
-        else if ( ps.lookingAt( "<=" ) )
-        {
-            op = LE;
-            ps.skip( 2 );
-        }
-        else if ( ps.lookingAt( ">" ) )
-        {
-            op = GT;
-            ps.skip( 1 );
-        }
-        else if ( ps.lookingAt( "<" ) )
-        {
-            op = LT;
-            ps.skip( 1 );
-        }
-        else if ( ps.lookingAt( "-=" ) )
-        {
-            op = APPROX;
-            ps.skip( 2 );
-        }
-        else if ( ps.isEndOfString() )
-        {
-            error( "unexpected end of expression", ps );
-        }
-        else
-        {
-            error( "unexpected character: '" + ps.peek() + "'", ps );
-        }
-        ps.skipWhitespace();
-
-        boolean escaped = false;
-        StringBuffer value = new StringBuffer( 16 );
-
-        while ( !ps.isEndOfString() && !Character.isWhitespace( ps.peek() ) && !( ps.peek() == ')' && !escaped ) )
-        {
-
-            char ch = ps.peek();
-
-            if ( ch == '\\' )
-            {
-                escaped = true;
-                ps.read();
-            }
-            else if ( ch == '*' )
-            {
-                if ( escaped )
-                {
-                    value.append( ch );
-                    escaped = false;
-                }
-                else
-                {
-                    value.append( SimpleTerm.WILDCARD );
-                }
-                ps.read();
-            }
-            else if ( isLiteralValue( ch ) )
-            {
-                if ( escaped )
-                {
-                    error( "incorrectly applied escape of '" + ch + "'", ps );
-                }
-                value.append( ps.read() );
-            }
-            else if ( isEscapedValue( ch ) )
-            {
-                if ( !escaped )
-                {
-                    error( "missing escape for '" + ch + "'", ps );
-                }
-                value.append( ps.read() );
-                escaped = false;
-            }
-            else
-            {
-                error( "unexpected character: '" + ps.peek() + "'", ps );
-            }
-        }
-        ps.skipWhitespace();
-
-        SimpleTerm expr = new SimpleTerm( name.toString(), op, value.toString() );
-
-        return expr;
-    }
-
-
-    private boolean isNameChar( int ch )
-    {
-        return !( Character.isWhitespace( ch ) || ( ch == '(' ) || ( ch == ')' ) || ( ch == '<' ) || ( ch == '>' )
-            || ( ch == '=' ) || ( ch == '~' ) || ( ch == '*' ) || ( ch == '\\' ) );
-    }
-
-
-    private boolean isLiteralValue( int ch )
-    {
-        return !( Character.isWhitespace( ch ) || ( ch == '(' ) || ( ch == ')' ) || ( ch == '*' ) );
-    }
-
-
-    private boolean isEscapedValue( int ch )
-    {
-        return ( ch == '(' ) || ( ch == ')' ) || ( ch == '*' );
-    }
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/Not.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/Not.java
deleted file mode 100644
index f8cd608..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/Not.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-import java.util.Map;
-
-
-public class Not implements LDAPExpr
-{
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-    private LDAPExpr[] children;
-
-
-    public static LDAPExpr apply( LDAPExpr e )
-    {
-        if ( e == null )
-        {
-            throw new NullPointerException( "cannot apply Not to a null expression" );
-        }
-        if ( e.equals( Expressions.T ) )
-        {
-            return Expressions.F;
-        }
-        if ( e.equals( Expressions.F ) )
-        {
-            return Expressions.T;
-        }
-        return new Not( e );
-    }
-
-
-    private Not( LDAPExpr child )
-    {
-        this.children = new LDAPExpr[]
-            { child };
-    }
-
-
-    public boolean eval( Map<String, ?> map )
-    {
-        return !children[0].eval( map );
-    }
-
-
-    public LDAPExpr getEx()
-    {
-        return children[0];
-    }
-
-
-    public void visit( ExprVisitor v )
-    {
-        v.visitNot( this );
-    }
-
-
-    public LDAPExpr[] getChildren()
-    {
-        return children;
-    }
-
-
-    public void setChild( LDAPExpr child )
-    {
-        this.children = new LDAPExpr[]
-            { child };
-    }
-
-
-    @Override
-    public boolean equals( Object other )
-    {
-        if ( other instanceof Not )
-        {
-            Not that = ( Not ) other;
-            return children[0].equals( that.children[0] );
-        }
-        return false;
-    }
-
-
-    @Override
-    public String toString()
-    {
-        StringBuffer buf = new StringBuffer( 256 );
-        buf.append( "(!" );
-        buf.append( " " ).append( children[0] ).append( " " );
-        buf.append( ")" );
-        return buf.toString();
-    }
-
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/Ops.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/Ops.java
deleted file mode 100644
index 29a0a8c..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/Ops.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-public enum Ops
-{
-    EQ, GE, LE, GT, LT, APPROX;
-
-    @Override
-    public String toString()
-    {
-        switch ( this )
-        {
-            case EQ:
-                return "=";
-            case GE:
-                return ">=";
-            case LE:
-                return "<=";
-            case GT:
-                return ">";
-            case LT:
-                return "<";
-            case APPROX:
-                return "~=";
-            default:
-                return super.toString();
-        }
-    }
-
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/Or.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/Or.java
deleted file mode 100644
index dc4af04..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/Or.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-import java.util.Map;
-
-
-public class Or implements LDAPExpr
-{
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-    private LDAPExpr[] children;
-
-
-    public static LDAPExpr apply( LDAPExpr... terms )
-    {
-        if ( terms == null )
-        {
-            throw new NullPointerException( "terms cannot be null" );
-        }
-        else if ( terms.length == 0 )
-        {
-            return Expressions.T;
-        }
-        else if ( terms.length == 1 )
-        {
-            return terms[0];
-        }
-        LDAPExpr[] filtered = new LDAPExpr[terms.length];
-        int ctr = 0;
-        for ( int i = 0; i < terms.length; i++ )
-        {
-            if ( terms[i].equals( Expressions.T ) )
-                return Expressions.T;
-            if ( terms[i].equals( Expressions.F ) )
-                continue;
-            filtered[ctr] = terms[i];
-            ctr++;
-        }
-        if ( ctr == 0 )
-        {
-            return Expressions.F;
-        }
-        else if ( ctr == 1 )
-        {
-            return filtered[0];
-        }
-        LDAPExpr[] orTerms = new LDAPExpr[ctr];
-        System.arraycopy( filtered, 0, orTerms, 0, ctr );
-
-        return new Or( orTerms );
-    }
-
-
-    private Or( LDAPExpr... children )
-    {
-        this.children = children;
-    }
-
-
-    public boolean eval( Map<String, ?> map )
-    {
-        for ( int i = 0; i < children.length; i++ )
-        {
-            if ( children[i].eval( map ) )
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-
-
-    public void visit( ExprVisitor v )
-    {
-        v.visitOr( this );
-    }
-
-
-    public LDAPExpr[] getChildren()
-    {
-        return children;
-    }
-
-
-    public void setChildren( LDAPExpr[] children )
-    {
-        this.children = children;
-    }
-
-
-    @Override
-    public boolean equals( Object other )
-    {
-        if ( other instanceof Or )
-        {
-            Or that = ( Or ) other;
-            if ( children.length != that.children.length )
-            {
-                return false;
-            }
-            for ( int i = 0; i < children.length; i++ )
-            {
-                if ( children[i].equals( that.children[i] ) )
-                {
-                    return true;
-                }
-            }
-            return false;
-        }
-        return false;
-    }
-
-
-    @Override
-    public String toString()
-    {
-        StringBuffer buf = new StringBuffer( 256 );
-        buf.append( "(|" );
-        for ( int i = 0; i < children.length; i++ )
-        {
-            buf.append( " " ).append( children[i] ).append( " " );
-        }
-        buf.append( ")" );
-        return buf.toString();
-    }
-
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/ParseState.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/ParseState.java
deleted file mode 100644
index 298cd7f..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/ParseState.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-import java.io.Serializable;
-
-
-/**
- * @author dave
- * 
- */
-class ParseState implements Serializable
-{
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-
-    int pos;
-
-    String str;
-
-
-    ParseState( String str )
-    {
-        this.str = str;
-    }
-
-
-    public boolean lookingAt( String start )
-    {
-        return str.substring( pos ).startsWith( start );
-    }
-
-
-    public CharSequence skip( int n )
-    {
-        int end = pos + n < str.length() ? pos + n : str.length();
-        int start = pos;
-        pos = end;
-        return str.subSequence( start, end );
-    }
-
-
-    public char read()
-    {
-        char ch = str.charAt( pos );
-        if ( pos < str.length() )
-        {
-            pos++;
-        }
-        return ch;
-    }
-
-
-    public char readAndSkipWhiteSpace()
-    {
-        char ch = read();
-        skipWhitespace();
-        return ch;
-    }
-
-
-    char peek()
-    {
-        if ( isEndOfString() )
-        {
-            return ( char ) -1;
-        }
-        return str.charAt( pos );
-    }
-
-
-    boolean isEndOfString()
-    {
-        return pos == str.length();
-    }
-
-
-    void skipWhitespace()
-    {
-        while ( pos < str.length() && Character.isWhitespace( str.charAt( pos ) ) )
-        {
-            pos++;
-        }
-    }
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/SimpleTerm.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/SimpleTerm.java
deleted file mode 100644
index a347539..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/SimpleTerm.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-import java.lang.reflect.Constructor;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-
-public class SimpleTerm implements LDAPExpr
-{
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-    public static final char WILDCARD = 2 ^ 16 - 1;
-    private static final String WILDCARD_STRING = new String( new char[]
-        { SimpleTerm.WILDCARD } );
-
-    private Ops op;
-    private String name;
-    private String rval;
-
-
-    public SimpleTerm( String name, Ops op, String value )
-    {
-        this.op = op;
-        this.name = name.intern();
-        this.rval = value.intern();
-    }
-
-
-    public String getName()
-    {
-        return name;
-    }
-
-
-    public Ops getOp()
-    {
-        return op;
-    }
-
-
-    public String getRval()
-    {
-        return rval;
-    }
-
-
-    public boolean eval( Map<String, ?> map )
-    {
-
-        Object lval = map.get( name );
-        if ( lval == null )
-        {
-            return false;
-        }
-        else if ( Ops.EQ == op && WILDCARD_STRING.equals( lval ) )
-        {
-            return true;
-        }
-        // any match in the vector will do
-        else if ( lval instanceof Vector<?> )
-        {
-            Vector<?> vec = ( Vector<?> ) lval;
-            for ( Iterator<?> i = vec.iterator(); i.hasNext(); )
-            {
-                if ( check( i.next() ) )
-                {
-                    return true;
-                }
-            }
-            return false;
-        }
-        // any match in the array will do
-        else if ( lval instanceof Object[] )
-        {
-            Object[] arr = ( Object[] ) lval;
-            for ( int i = 0; i < arr.length; i++ )
-            {
-                if ( check( arr[i] ) )
-                {
-                    return true;
-                }
-            }
-            return false;
-        }
-        return check( lval );
-    }
-
-
-    @SuppressWarnings("unchecked")
-    private boolean check( Object lval )
-    {
-        if ( lval == null )
-        {
-            return false;
-        }
-        else if ( Ops.EQ == op && WILDCARD_STRING.equals( lval ) )
-        {
-            return true;
-        }
-
-        Object rhs = null;
-
-        if ( lval instanceof String )
-        {
-
-            if ( Ops.APPROX == op )
-            {
-                rhs = collapseWhiteSpace( rval );
-                lval = collapseWhiteSpace( ( String ) lval );
-            }
-
-            if ( Ops.EQ == op || Ops.APPROX == op )
-            {
-                return stringCheck( ( String ) lval );
-            }
-            // rhs already a string
-
-        }
-        else if ( lval.getClass() == Byte.class )
-        {
-            rhs = Byte.valueOf( rval );
-        }
-        else if ( lval.getClass() == Short.class )
-        {
-            rhs = Short.valueOf( rval );
-        }
-        else if ( lval.getClass() == Integer.class )
-        {
-            rhs = Integer.valueOf( rval );
-        }
-        else if ( lval.getClass() == Long.class )
-        {
-            rhs = Long.valueOf( rval );
-        }
-        else if ( lval.getClass() == Float.class )
-        {
-            rhs = Float.valueOf( rval );
-        }
-        else if ( lval.getClass() == Double.class )
-        {
-            rhs = Double.valueOf( rval );
-        }
-        else
-        {
-            try
-            {
-                Constructor<?> stringCtor = lval.getClass().getConstructor( new Class[]
-                    { String.class } );
-                rhs = stringCtor.newInstance( rval );
-            }
-            catch ( Exception e )
-            {
-                // log it
-                e.printStackTrace();
-                return false;
-            }
-        }
-
-        if ( !( lval instanceof Comparable ) )
-        {
-            return Ops.EQ == op && lval.equals( rval );
-        }
-        else
-        {
-
-            Comparable<? super Object> lhs = ( Comparable<? super Object> ) lval;
-
-            int compare = lhs.compareTo( rhs );
-
-            switch ( op )
-            {
-                case EQ:
-                    return compare == 0;
-                case APPROX:
-                    return compare == 0;
-                case GE:
-                    return compare >= 0;
-                case LE:
-                    return compare <= 0;
-                case GT:
-                    return compare > 0;
-                case LT:
-                    return compare < 0;
-            }
-        }
-
-        return false;
-    }
-
-
-    private boolean stringCheck( String lhs )
-    {
-
-        String rhs;
-        switch ( op )
-        {
-            case EQ:
-            case APPROX:
-                rhs = rval;
-                break;
-            default:
-                return false;
-        }
-
-        int valLength = lhs.length();
-        int patLength = rval.length();
-
-        if ( valLength == 0 && patLength == 0 )
-        {
-            return true;
-        }
-
-        boolean wc = false;
-        int j = 0;
-        for ( int i = 0; i < patLength; i++ )
-        {
-            // trailing wildcards
-            char pc = rhs.charAt( i );
-            if ( j == valLength )
-            {
-                if ( pc != SimpleTerm.WILDCARD )
-                {
-                    return false;
-                }
-                continue;
-            }
-            if ( pc == SimpleTerm.WILDCARD )
-            {
-                wc = true;
-                continue;
-            }
-            while ( wc && j < valLength - 1 && lhs.charAt( j ) != pc )
-            {
-                j++;
-            }
-            if ( lhs.charAt( j ) != pc )
-            {
-                return false;
-            }
-            else
-            {
-                wc = false;
-                j++;
-            }
-        }
-        return ( wc || j == valLength );
-
-    }
-
-
-    private String collapseWhiteSpace( String in )
-    {
-        StringBuffer out = new StringBuffer( in.trim().length() );
-        boolean white = false;
-        for ( int i = 0; i < in.length(); i++ )
-        {
-            char ch = in.charAt( i );
-            if ( Character.isWhitespace( ch ) )
-            {
-                white = true;
-            }
-            else
-            {
-                if ( white )
-                {
-                    out.append( " " );
-                    white = false;
-                }
-                out.append( ch );
-            }
-        }
-        return out.toString();
-    }
-
-
-    public void visit( ExprVisitor v )
-    {
-        v.visitSimple( this );
-    }
-
-
-    public LDAPExpr[] getChildren()
-    {
-        return CHILDLESS;
-    }
-
-
-    @Override
-    public boolean equals( Object other )
-    {
-        if ( other instanceof SimpleTerm )
-        {
-            SimpleTerm that = ( SimpleTerm ) other;
-            return name.equals( that.name ) && op.equals( that.op ) && rval.equals( that.rval );
-        }
-        return false;
-    }
-
-
-    @Override
-    public String toString()
-    {
-        return "(" + name + " " + op.toString() + " " + escape( rval ) + ")";
-    }
-
-
-    private String escape( String raw )
-    {
-        StringBuffer buf = new StringBuffer( raw.length() + 10 );
-        for ( int i = 0; i < raw.length(); i++ )
-        {
-            char ch = raw.charAt( i );
-            switch ( ch )
-            {
-                case SimpleTerm.WILDCARD:
-                    buf.append( "*" );
-                    break;
-                case '(':
-                case ')':
-                case '*':
-                    buf.append( "\\" ).append( ch );
-                    break;
-                default:
-                    buf.append( ch );
-            }
-        }
-        return buf.toString();
-    }
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/Utils.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/Utils.java
deleted file mode 100644
index 14a4d04..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/Utils.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-
-public class Utils
-{
-    public static MapBuilder map( String name, Object value )
-    {
-        return new MapBuilder().put( name, value );
-    }
-
-
-    public static String toString( Map<String, Object> attrs )
-    {
-        if ( attrs == null )
-        {
-            return "NULL";
-        }
-
-        StringBuffer buf = new StringBuffer( 128 );
-        List<String> keys = new ArrayList<String>( attrs.keySet() );
-        Collections.sort( keys );
-        buf.append( "{" );
-
-        for ( int i = 0; i < keys.size(); i++ )
-        {
-            Object name = keys.get( i );
-            Object value = attrs.get( name );
-            buf.append( name ).append( "=" ).append( value ).append( "," );
-        }
-
-        if ( buf.length() > 1 )
-        {
-            buf.delete( buf.length() - 1, buf.length() );
-        }
-
-        buf.append( "}" );
-
-        return buf.toString();
-    }
-
-    public static class MapBuilder
-    {
-        private Map<String, Object> map = new HashMap<String, Object>();
-
-
-        public MapBuilder put( String name, Object value )
-        {
-            map.put( name, value );
-
-            return this;
-        }
-
-
-        public Map<String, Object> toMap()
-        {
-            return map;
-        }
-    }
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/VersionRange.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/VersionRange.java
deleted file mode 100644
index 9448088..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/VersionRange.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-import java.io.Serializable;
-
-import org.osgi.framework.Version;
-
-
-public class VersionRange implements Serializable
-{
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-    public static final Version INFINITE_VERSION = new Version( Integer.MAX_VALUE, Integer.MAX_VALUE,
-        Integer.MAX_VALUE, "" );
-    public static final VersionRange ANY_VERSION = new VersionRange( false, Version.emptyVersion, INFINITE_VERSION,
-        true );
-
-    private boolean openFloor;
-    private Version floor;
-    private Version ceiling;
-    private boolean openCeiling;
-
-
-    /**
-     * Interval constructor
-     * 
-     * @param openFloor Whether the lower bound of the range is inclusive (false) or exclusive (true).
-     * @param floor The lower bound version of the range.
-     * @param ceiling The upper bound version of the range.
-     * @param openCeiling Whether the upper bound of the range is inclusive (false) or exclusive (true).
-     */
-    public VersionRange( boolean openFloor, Version floor, Version ceiling, boolean openCeiling )
-    {
-        this.openFloor = openFloor;
-        this.floor = floor;
-        this.ceiling = ceiling;
-        this.openCeiling = openCeiling;
-    }
-
-
-    /**
-     * atLeast constructor
-     * 
-     * @param openFloor
-     * @param floor
-     */
-    public VersionRange( Version atLeast )
-    {
-        this.openFloor = false;
-        this.floor = atLeast;
-        this.ceiling = INFINITE_VERSION;
-        this.openCeiling = true;
-    }
-
-
-    public static VersionRange parseVersionRange( String val ) throws IllegalArgumentException, NumberFormatException
-    {
-        if ( val == null || val.trim().length() == 0 )
-        {
-            return ANY_VERSION;
-        }
-
-        boolean openFloor;
-        boolean openCeiling;
-        val = val.replaceAll( "\\s", "" );
-        val = val.replaceAll( "\"", "" );
-        int fst = val.charAt( 0 );
-        if ( fst == '[' )
-        {
-            openFloor = false;
-        }
-        else if ( fst == '(' )
-        {
-            openFloor = true;
-        }
-        else
-        {
-            Version atLeast = Version.parseVersion( val );
-            return new VersionRange( atLeast );
-        }
-
-        int lst = val.charAt( val.length() - 1 );
-        if ( lst == ']' )
-        {
-            openCeiling = false;
-        }
-        else if ( lst == ')' )
-        {
-            openCeiling = true;
-        }
-        else
-        {
-            throw new IllegalArgumentException( "illegal version range syntax " + val
-                + ": range must end in ')' or ']'" );
-        }
-
-        String inner = val.substring( 1, val.length() - 1 );
-        String[] floorCeiling = inner.split( "," );
-        if ( floorCeiling.length != 2 )
-        {
-            throw new IllegalArgumentException( "illegal version range syntax " + "too many commas" );
-        }
-        Version floor = Version.parseVersion( floorCeiling[0] );
-        Version ceiling = "*".equals( floorCeiling[1] ) ? INFINITE_VERSION : Version.parseVersion( floorCeiling[1] );
-        return new VersionRange( openFloor, floor, ceiling, openCeiling );
-    }
-
-
-    public Version getCeiling()
-    {
-        return ceiling;
-    }
-
-
-    public Version getFloor()
-    {
-        return floor;
-    }
-
-
-    public boolean isOpenCeiling()
-    {
-        return openCeiling;
-    }
-
-
-    public boolean isOpenFloor()
-    {
-        return openFloor;
-    }
-
-
-    public boolean isPointVersion()
-    {
-        return !openFloor && !openCeiling && floor.equals( ceiling );
-    }
-
-
-    /**
-     * test a version to see if it falls in the range
-     * 
-     * @param version
-     * @return
-     */
-    public boolean contains( Version version )
-    {
-        if ( version.equals( INFINITE_VERSION ) )
-        {
-            return ceiling.equals( INFINITE_VERSION );
-        }
-        else
-        {
-            return ( version.compareTo( floor ) > 0 && version.compareTo( ceiling ) < 0 )
-                || ( !openFloor && version.equals( floor ) ) || ( !openCeiling && version.equals( ceiling ) );
-        }
-    }
-
-
-    @Override
-    public int hashCode()
-    {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ( ( ceiling == null ) ? 0 : ceiling.hashCode() );
-        result = prime * result + ( ( floor == null ) ? 0 : floor.hashCode() );
-        result = prime * result + ( openCeiling ? 1231 : 1237 );
-        result = prime * result + ( openFloor ? 1231 : 1237 );
-        return result;
-    }
-
-
-    @Override
-    public boolean equals( Object obj )
-    {
-        if ( this == obj )
-            return true;
-        if ( obj == null )
-            return false;
-        if ( getClass() != obj.getClass() )
-            return false;
-        final VersionRange other = ( VersionRange ) obj;
-        if ( ceiling == null )
-        {
-            if ( other.ceiling != null )
-                return false;
-        }
-        else if ( !ceiling.equals( other.ceiling ) )
-            return false;
-        if ( floor == null )
-        {
-            if ( other.floor != null )
-                return false;
-        }
-        else if ( !floor.equals( other.floor ) )
-            return false;
-        if ( openCeiling != other.openCeiling )
-            return false;
-        if ( openFloor != other.openFloor )
-            return false;
-        return true;
-    }
-
-
-    @Override
-    public String toString()
-    {
-        if ( ANY_VERSION.equals( this ) )
-        {
-            return makeString( openFloor, Version.emptyVersion, INFINITE_VERSION, openCeiling );
-        }
-        return makeString( openFloor, floor, ceiling, openCeiling );
-    }
-
-
-    private String makeString( boolean openFloor, Version floor, Version ceiling, boolean openCeiling )
-    {
-        StringBuffer vr = new StringBuffer( 32 );
-        if ( INFINITE_VERSION.equals( ceiling ) )
-        {
-            vr.append( Version.emptyVersion.equals( floor ) ? "0" : floor.toString() );
-        }
-        else
-        {
-            vr.append( openFloor ? "(" : "[" );
-            String floorStr = Version.emptyVersion.equals( floor ) ? "0" : floor.toString();
-            String ceilingStr = ceiling.toString();
-            vr.append( floorStr ).append( "," ).append( ceilingStr );
-            vr.append( openCeiling ? ")" : "]" );
-        }
-        return vr.toString();
-    }
-
-
-    public static VersionRange newInstance( Version pointVersion, VersionRangeBoundingRule lowerBoundRule,
-        VersionRangeBoundingRule upperBoundRule )
-    {
-        Version floor = null;
-        switch ( lowerBoundRule )
-        {
-            case Any:
-                floor = new Version( 0, 0, 0 );
-                break;
-            case Major:
-                floor = new Version( pointVersion.getMajor(), 0, 0 );
-                break;
-            case Minor:
-                floor = new Version( pointVersion.getMajor(), pointVersion.getMinor(), 0 );
-                break;
-            case Micro:
-                floor = new Version( pointVersion.getMajor(), pointVersion.getMinor(), pointVersion.getMicro() );
-                break;
-            case Exact:
-                floor = pointVersion;
-                break;
-        }
-
-        Version ceiling = null;
-        boolean openCeiling = true;
-        switch ( upperBoundRule )
-        {
-            case Any:
-                ceiling = INFINITE_VERSION;
-                break;
-            case Major:
-                ceiling = new Version( pointVersion.getMajor() + 1, 0, 0 );
-                break;
-            case Minor:
-                ceiling = new Version( pointVersion.getMajor(), pointVersion.getMinor() + 1, 0 );
-                break;
-            case Micro:
-                ceiling = new Version( pointVersion.getMajor(), pointVersion.getMinor(), pointVersion.getMicro() + 1 );
-                break;
-            case Exact:
-                ceiling = pointVersion;
-                openCeiling = false;
-                break;
-        }
-
-        return new VersionRange( false, floor, ceiling, openCeiling );
-    }
-}
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/common/VersionRangeBoundingRule.java b/sigil/common/core/src/org/apache/felix/sigil/model/common/VersionRangeBoundingRule.java
deleted file mode 100644
index c1f6f14..0000000
--- a/sigil/common/core/src/org/apache/felix/sigil/model/common/VersionRangeBoundingRule.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.felix.sigil.model.common;
-
-
-public enum VersionRangeBoundingRule
-{
-    Exact, Micro, Minor, Major, Any
-}
\ No newline at end of file
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/eclipse/ILibraryImport.java b/sigil/common/core/src/org/apache/felix/sigil/model/eclipse/ILibraryImport.java
index 664e32f..79e5fa2 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/model/eclipse/ILibraryImport.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/model/eclipse/ILibraryImport.java
@@ -20,8 +20,8 @@
 package org.apache.felix.sigil.model.eclipse;
 
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.model.IModelElement;
-import org.apache.felix.sigil.model.common.VersionRange;
 
 
 public interface ILibraryImport extends IModelElement
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/osgi/IRequiredBundle.java b/sigil/common/core/src/org/apache/felix/sigil/model/osgi/IRequiredBundle.java
index d039c84..fa64308 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/model/osgi/IRequiredBundle.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/model/osgi/IRequiredBundle.java
@@ -20,9 +20,9 @@
 package org.apache.felix.sigil.model.osgi;
 
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.model.IModelElement;
 import org.apache.felix.sigil.model.IRequirementModelElement;
-import org.apache.felix.sigil.model.common.VersionRange;
 
 
 public interface IRequiredBundle extends IModelElement, IRequirementModelElement, Comparable<IRequiredBundle>
diff --git a/sigil/common/core/src/org/apache/felix/sigil/model/osgi/IVersionRangeModelElement.java b/sigil/common/core/src/org/apache/felix/sigil/model/osgi/IVersionRangeModelElement.java
index 83d8bf4..5e3bea5 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/model/osgi/IVersionRangeModelElement.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/model/osgi/IVersionRangeModelElement.java
@@ -19,9 +19,7 @@
 
 package org.apache.felix.sigil.model.osgi;
 
-
-import org.apache.felix.sigil.model.common.VersionRange;
-
+import org.apache.felix.sigil.common.osgi.VersionRange;
 
 public interface IVersionRangeModelElement
 {
diff --git a/sigil/common/core/src/org/apache/felix/sigil/repository/AbstractBundleRepository.java b/sigil/common/core/src/org/apache/felix/sigil/repository/AbstractBundleRepository.java
index 2d459a7..dbd81ad 100644
--- a/sigil/common/core/src/org/apache/felix/sigil/repository/AbstractBundleRepository.java
+++ b/sigil/common/core/src/org/apache/felix/sigil/repository/AbstractBundleRepository.java
@@ -29,6 +29,7 @@
 import java.util.jar.Attributes;
 import java.util.jar.Manifest;
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.core.BldCore;
 import org.apache.felix.sigil.core.licence.ILicenseManager;
 import org.apache.felix.sigil.core.licence.ILicensePolicy;
@@ -36,7 +37,6 @@
 import org.apache.felix.sigil.model.IModelElement;
 import org.apache.felix.sigil.model.ModelElementFactory;
 import org.apache.felix.sigil.model.ModelElementFactoryException;
-import org.apache.felix.sigil.model.common.VersionRange;
 import org.apache.felix.sigil.model.eclipse.ILibrary;
 import org.apache.felix.sigil.model.eclipse.ISigilBundle;
 import org.apache.felix.sigil.model.osgi.IBundleModelElement;
